#pragma warning disable 108
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using Cephei;
using Cephei.Core;
using Cephei.Core.Generic;
using Microsoft.FSharp.Core;
using Cephei.QL.Times;
using Cephei.QL.Indexes;
using Cephei.QL;
namespace Cephei.QL.Instruments
{
    /// <summary> 
	/// ! Quoted as a fixed strike rate \f$ K \f$.  Payoff: \f[ P_n(0,T) \max(y (N [(1+K)^{T}-1] - N \left[ \frac{I(T)}{I(0)} -1 \right]), 0) \f] where \f$ T \f$ is the maturity time, \f$ P_n(0,t) \f$ is the nominal discount factor at time \f$ t \f$, \f$ N \f$ is the notional, and \f$ I(t) \f$ is the inflation index value at time \f$ t \f$.  Inflation is generally available on every day, including holidays and weekends.  Hence there is a variable to state whether the observe/fix dates for inflation are adjusted or not.  The default is not to adjust.  N.B. a cpi cap or floor is an option, not a cap or floor on a coupon. Thus this is very similar to a ZCIIS and has a single flow, this is as usual for cpi because it is cumulative up to option maturity from base date.  We do not inherit from Option, although this would be reasonable, because we do not have that degree of generality.
	/// </summary>
    [Guid ("9BE0D921-74D0-4e92-909E-703B7645AD99"),ComVisible(true)]
	public interface ICPICapFloor : Cephei.QL.IInstrument
	{
		///////////////////////////////////////////////////////////////
        // Methods
        //
        /// <summary> 
		/// ! when you fix - but remember that there is an observation interpolation factor as well
		/// </summary>
		 DateTime FixingDate {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Cephei.QL.Indexes.IZeroInflationIndex InflationIndex {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Boolean IsExpired {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double Nominal {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Cephei.QL.Times.IPeriod ObservationLag {get;}
        /// <summary> 
		/// 
		/// </summary>
		 DateTime PayDate {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double Strike {get;}
        /// <summary> 
		/// 
		/// </summary>
		 QL.Option.TypeEnum Type {get;}
    }   

    /// <summary> 
	/// ! Quoted as a fixed strike rate \f$ K \f$.  Payoff: \f[ P_n(0,T) \max(y (N [(1+K)^{T}-1] - N \left[ \frac{I(T)}{I(0)} -1 \right]), 0) \f] where \f$ T \f$ is the maturity time, \f$ P_n(0,t) \f$ is the nominal discount factor at time \f$ t \f$, \f$ N \f$ is the notional, and \f$ I(t) \f$ is the inflation index value at time \f$ t \f$.  Inflation is generally available on every day, including holidays and weekends.  Hence there is a variable to state whether the observe/fix dates for inflation are adjusted or not.  The default is not to adjust.  N.B. a cpi cap or floor is an option, not a cap or floor on a coupon. Thus this is very similar to a ZCIIS and has a single flow, this is as usual for cpi because it is cumulative up to option maturity from base date.  We do not inherit from Option, although this would be reasonable, because we do not have that degree of generality. Factory
	/// </summary>
   	[ComVisible(true)]
    public interface ICPICapFloor_Factory 
    {
        ///////////////////////////////////////////////////////////////
        // Factory methods
        //
        /// <summary> 
		/// 
		/// </summary>
	    ICPICapFloor Create (QL.Option.TypeEnum type, Double nominal, DateTime startDate, Double baseCPI, DateTime maturity, Cephei.QL.Times.ICalendar fixCalendar, QL.Times.BusinessDayConventionEnum fixConvention, Cephei.QL.Times.ICalendar payCalendar, QL.Times.BusinessDayConventionEnum payConvention, Double strike, Cephei.QL.Indexes.IZeroInflationIndex infIndex, Cephei.QL.Times.IPeriod observationLag, Microsoft.FSharp.Core.FSharpOption<QL.Cashflows.CPI.InterpolationTypeEnum> observationInterpolation, Cephei.QL.IPricingEngine QL_Pricer);
    }
}

